package org.spindle.dungeon.entities;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Image;
import org.spindle.dungeon.Constants;
import org.spindle.dungeon.LevelProperties;


public class WallEntity extends GeneralEntity {

    @Override
    protected void initialize() {
        staticImage = true;

        spritesList.add(Constants.SPRITE_SHEET.getSprite(0, 0));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(1, 1));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(2, 1));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(3, 1));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(1, 2));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(2, 2));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(3, 2));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(1, 3));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(2, 3));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(3, 3));

        spritesList.add(Constants.SPRITE_SHEET.getSprite(1, 4));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(3, 4));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(1, 5));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(3, 5));
        spritesList.add(Constants.SPRITE_SHEET.getSprite(5, 1));

    }

    @Override
    public void updateBy(Object map, int type) {
        if (type == 2) {
            spriteIndex = 14;
        } else if (map.equals("111111111")) {
            //spritesList = mm;
            spriteIndex = 5;
        } else if (map.equals("000011011")) {
            //spritesList = tl;
            spriteIndex = 1;
        } else if (map.equals("000110110")) {
            //spritesList = tr;
            spriteIndex = 3;
        } else if (map.equals("000111111") || map.equals("100111111") || map.equals("001111111")) {
            //spritesList = tm;
            spriteIndex = 2;
        } else if (map.equals("011011011") || map.equals("011011111") || map.equals("111011011") || map.equals("211011011") || map.equals("111211011")) {
            //spritesList = ml;
            spriteIndex = 4;
        } else if (map.equals("110110110") || map.equals("110110111") || map.equals("111110110") || map.equals("112110110") || map.equals("111112110")) {
            //spritesList = mr;
            spriteIndex = 6;
        } else if (map.equals("111111000") || map.equals("111111001") || map.equals("100111111") || map.equals("111111100") || map.equals("111111222") || map.equals("111111122") || map.equals("111111221")) {
            //spritesList = bm;
            spriteIndex = 8;
        } else if (map.equals("011011000") || map.equals("011011022") || map.equals("011011222")) {
            //spritesList = bl;
            spriteIndex = 7;
        } else if (map.equals("110110000") || map.equals("110110220") || map.equals("110110222")) {
            //spritesList = br;
            spriteIndex = 9;
        } else if (map.equals("110111111")) {
            //spritesList = ibl;
            spriteIndex = 12;
        } else if (map.equals("011111111")) {
            //spritesList = ibr;
            spriteIndex = 13;
        } else if (map.equals("111111110") || map.equals("111111112")) {
            //spritesList = itl;
            spriteIndex = 10;
        } else if (map.equals("111111011") || map.equals("111111211")) {
            //spritesList = itr;
            spriteIndex = 11;
        } else {
            System.out.println(map);
        }
    }

    @Override
    public void update(GameContainer gc, LevelProperties props) {

    }
}
